//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.ObjectModel;
using System.Diagnostics.Contracts;
using System.Windows.Data;

namespace OpenLS.Spreadsheet.UI
{
    class WorksheetPaneToCommentsConverter: IMultiValueConverter
    {
        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values == null)
                return null;
            WorksheetPane pane = (WorksheetPane) values[0];
            if (pane == null)
                return null;
            int generation = (int) values[1];
            return pane.Comments();
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }

        #endregion
    }
}
